package cn.lumora.service.impl;

import cn.lumora.mapper.PlayerMapper;
import cn.lumora.pojo.Player;
import cn.lumora.service.PlayerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class PlayerServiceImpl extends ServiceImpl<PlayerMapper, Player> implements PlayerService {
    @Override
    public Player getPlayerByUsername(String username) {
        LambdaQueryWrapper<Player> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.select(Player::getUsername,Player::getPassword,Player::getNickname,Player::getId);
        queryWrapper.eq(Player::getUsername, username);
        return getOne(queryWrapper);
    }
}
